# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Josh VanderLinden <arch@cloudlery.com>
# Contributor: Nicolas Storme <nicolas@atelier-web.com>

pkgname=goaccess
pkgver=1.8.1
pkgrel=1
pkgdesc="An open source real-time web log analyzer and interactive viewer"
arch=('loong64' 'x86_64')
url='https://goaccess.io'
license=('GPL')
depends=('ncurses' 'libmaxminddb' 'openssl')
optdepends=('geoip2-database: for geoip support')
backup=('etc/goaccess/goaccess.conf')
source=("https://tar.goaccess.io/$pkgname-$pkgver.tar.gz")
sha512sums=('96f0b73f13cfb77ad57748bce7d8791f8486bfd5ce47420d1c0016826a4deb9ab2d2742f4afd5d8b0eed003f9b596aae51f232fa71bf47f823b6ff8119f91354')

build() {
  cd $pkgname-$pkgver
  ./configure --enable-geoip=mmdb --enable-utf8 --with-openssl
  make prefix=/usr sysconfdir=/etc
}

package() {
  cd $pkgname-$pkgver
  make prefix="$pkgdir/usr" sysconfdir="$pkgdir/etc" install
}
